﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ExecuteWithComments.aspx.cs" Inherits="BEGDC.CC.Web.Workflow.Dialog.ExecuteWithComments" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Comments</title>
    <link href="../../css/global.css" type="text/css" rel="stylesheet" />
    <link href="../../css/style.css" type="text/css" rel="stylesheet" />

    <script type="text/javascript" language="javascript">
        var sourceActionButton;

        function validateExecute() {
            var actionType = sourceActionButton.actionType;
            if (actionType == "Reject" || actionType == "AskForMore") {
                var comment = document.getElementById("txtComments").value;
                if (comment == null || comment == "") {
                    alert(document.getElementById("hidCommentRequired").value);
                    return false;
                }
                return true;
            }
            return true;
        }

        function execute() {
            if (!validateExecute()) return;
            if (opener && opener.__wf_doActionPostBack) {
                var comment = document.getElementById("txtComments").value;
                opener.__wf_doActionPostBack(sourceActionButton, null, comment);
                window.close();
            }
        }

        window.onload = function() {
            sourceActionButton = opener.__wf_sourceActionButton;
        }
    </script>

</head>
<body style="background: none;">
    <h3 class="ev-header-section">
        &nbsp;COMMENTS</h3>
    <form id="form1" runat="server">
    <table width="100%">
        <tr class="ev-row2">
            <td class="title" width="28%">
                <span class="Star">*</span>Your Comments ：<br />
                您的意见&nbsp;&nbsp;
            </td>
            <td class="val">
                <asp:TextBox ID="txtComments" runat="server" TextMode="MultiLine" Rows="6" Width="98%"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td colspan="2" class="padding5 ac">
                <br />
                <asp:Button runat="server" ID="btnExecute" CssClass="btn" OnClientClick="execute(); return" UseSubmitBehavior="false" />&nbsp;
                <asp:Button runat="server" ID="btnCancel" Text="<%$ Resources:Workflow, Cancel%>" CssClass="btn" OnClientClick="window.opener=null;window.close(); return false;"
                    UseSubmitBehavior="false" />
            </td>
        </tr>
    </table>
    <asp:HiddenField ID="hidCommentRequired" runat="server" />
    </form>
</body>
</html>